﻿<?xml version="1.0" encoding="utf-8"?>
<Window
	x:Class="ICSharpCode.WpfDesign.AddIn.ImageSourceEditor.ChooseImageDialog" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	Background="{x:Static SystemColors.ControlBrush}"
	SnapsToDevicePixels="True"
	WindowStartupLocation="CenterScreen"
	ResizeMode="CanResizeWithGrip"
	Title="Choose Image"
	Height="438"
	Width="488">
	<Window.Resources>
		<Style
			TargetType="ListBox">
			<Setter
				Property="ItemsPanel">
				<Setter.Value>
					<ItemsPanelTemplate>
						<StackPanel
							Orientation="Horizontal"
							VerticalAlignment="Top"
							HorizontalAlignment="Center" />
					</ItemsPanelTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<CollectionViewSource
			x:Key="groups"
			Source="{Binding}">
			<CollectionViewSource.GroupDescriptions>
				<PropertyGroupDescription
					PropertyName="Header" />
			</CollectionViewSource.GroupDescriptions>
		</CollectionViewSource>
	</Window.Resources>
	<Grid>
		<TextBlock
			HorizontalAlignment="Left"
			VerticalAlignment="Top"
			Margin="12,12,0,0"
			Text="Existing images"
			Height="24" />
		<ListBox
			MouseDoubleClick="ImageDisplayDoubleClick"
			Name="imgDisplay"
			Margin="12,37,12,120">
			<ListBox.ItemsPanel>
				<ItemsPanelTemplate>
					<WrapPanel />
				</ItemsPanelTemplate>
			</ListBox.ItemsPanel>
			<ListBox.ItemTemplate>
				<DataTemplate>
					<StackPanel
						Margin="10,10,10,6">
						<Border
							BorderThickness="1"
							BorderBrush="#FF717171"
							Background="White">
							<Border.Effect>
								<DropShadowEffect
									Color="#FFA1A1A1" />
							</Border.Effect>
							<Image
								Source="{Binding FullName}"
								Height="100"
								Width="100"
								Margin="2,5,2,5" />
						</Border>
						<TextBlock
							Text="{Binding Name, Mode=OneWay}"
							TextAlignment="Center"
							TextTrimming="CharacterEllipsis"
							MaxWidth="100"
							Margin="0,0,0,4" />
					</StackPanel>
				</DataTemplate>
			</ListBox.ItemTemplate>
		</ListBox>
		<Button
			Height="23"
			Width="75"
			Margin="0,0,12,88"
			VerticalAlignment="Bottom"
			HorizontalAlignment="Right"
			Content="Add"
			Click="AddClick" />
		<TextBlock
			Text="URL:"
			VerticalAlignment="Bottom"
			HorizontalAlignment="Left"
			Margin="12,0,0,53"
			Height="24" />
		<TextBox
			HorizontalAlignment="Stretch"
			VerticalAlignment="Bottom"
			Margin="50,0,12,56"
			Height="24"
			IsReadOnly="True"
			Text="{Binding Path=SelectedItem.FullName, ElementName=imgDisplay, Mode=OneWay}"
			Name="txURL" />
		<Button
			x:Name="uxOk"
			Content="OK"
			Height="23"
			Margin="0,0,93,12"
			VerticalAlignment="Bottom"
			HorizontalAlignment="Right"
			Width="75"
			IsDefault="True"
			Click="OkClick" />
		<Button
			Content="Cancel"
			Name="uxCancel"
			Click="Cancel"
			Height="23"
			HorizontalAlignment="Right"
			Margin="0,0,12,12"
			VerticalAlignment="Bottom"
			Width="75"
			IsCancel="True" />
	</Grid>
</Window>